/**
 * 用户信息接口
 * @example 占位符防止sql注入攻击 'SELECT * FROM user WHERE username = ? AND password = ?'
 * **/
const { query } = require('./query');
const jwt = require('jsonwebtoken');
const rsa = require('../Rsa/index.js');

// 测试查询接口

/**
 * 'select * from user WHERE userName = ?;',
    [''],
 * **/
// 用户登录接口
function Login() {
  query('/login', 200, 'post').then(async (res) => {
    let info = await res.cb('select * from user WHERE userName = ?;', [
      res.req.body.name
    ]);
    console.log(info, 'pppp');
    res.send('', info);
  });
}

module.exports = {
  UserApiIndex: function () {
    Login();
  }
};
